package ua.com.infopulse.believeornevers.activities;

import ua.com.infopulse.believeornevers.R;
import ua.com.infopulse.believeornevers.data.RandomData;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class AcDoYouKnow extends Activity {

	private TextView txt;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ac_do_you_know);
		txt = (TextView) findViewById(R.id.txtAcStartDoYouKnow);
		RandomData rd = new RandomData(this, R.array.random_sentences);
		int random=(int) (Math.random()*rd.data.length);
	    txt.setText(rd.data[random]);
		txt.setOnClickListener(getListener());
	}

	private OnClickListener getListener() {
		// TODO Auto-generated method stub
		return new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AcDoYouKnow.this, AcMenu.class);
				startActivity(intent);
				finish();
			}
		};
	}

}
